home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-03-06 | 1.1 KB | 40 lines | [TEXT/GEOL] |
- Item 8815202 27-July-90 08:21PDT
-
- From: DEREK White, Derek
-
- To: CPLUS.DEV$ C++ Interest List--Developers
- CPLUS.APPLE$ C++ Interest List--Apple Employees
-
- Sub: "overloading" fields?
-
- I've got C++ programming style question:
-
- Should you "overload" field names in a derived class?
-
- I was playing with C++ to see if you could override static functions, then I
- looked at static class variables. Then for fun (I never thought it was
- possible), I tried overloading a field name and it worked. Note that
- everything is public:
-
- class TShape {
- public:
- TShape(void);
- static int gStatic;
- static void foo();
- intfDum, fDum2;
- };
-
- class TRect: public TShape {
- public:
- TRect(void);
- double fDum; //***you CAN "overload" fields***
- static int gStatic; //you can "overload" static vars
- static void foo(int); //you can "overload" static funcs
- };
-
- Does anyone take advantage of this? Any arguments pro or con?
- - Derek White
- ATG East/Columbia
- Apple Computer
-
-